import cv2
import time
import random

fontFaces = [
    cv2.FONT_HERSHEY_SIMPLEX,
    cv2.FONT_HERSHEY_PLAIN,
    cv2.FONT_HERSHEY_DUPLEX,
    cv2.FONT_HERSHEY_COMPLEX,
    cv2.FONT_HERSHEY_COMPLEX_SMALL,
    cv2.FONT_HERSHEY_SCRIPT_SIMPLEX,
    cv2.FONT_HERSHEY_SCRIPT_COMPLEX,
    cv2.FONT_ITALIC
]

number = "2"

for i in range(100):
    base_img = cv2.imread("./base.png")
    rand_face = random.randint(0,len(fontFaces) - 1)
    rand_scale = 1 + random.random() * 2
    rand_thickness = random.randint(1,5)
    rand_color = (random.randint(10,255),random.randint(10,255),random.randint(10,255))

    cv2.putText(base_img,number,
                (int(rand_scale + random.randint(1,3)) * 10,int(rand_scale + 5) * 10),
                fontFaces[rand_face],
                rand_scale,
                rand_color,
                rand_thickness)

    cv2.imwrite(f"./data/numbers/validation/{number}/{int(time.time())}.{number}.jpg",base_img)
    cv2.waitKey(500)
